import Credit from "./Credit.js";
import defined from "./defined.js";
import Resource from "./Resource.js";

var defaultTokenCredit;
var defaultAccessToken =
  "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkZjZmNmEzYy0zOWUwLTQzMTEtODNlMC1hY2EwZTRkNjQyNWUiLCJpZCI6MjU5LCJpYXQiOjE2Mjc5MTg0MjB9.VbQeEhbHiWrAH5KAAl1ynNkI4kHWxJdDi78IcCZxFk4";
/**
 * Default settings for accessing the QuarkGIS ion API.
 *
 * An ion access token is only required if you are using any ion related APIs.
 * A default access token is provided for evaluation purposes only.
 * Sign up for a free ion account and get your own access token at {@link https://quarkgis.com}
 *
 * @see IonResource
 * @see IonImageryProvider
 * @see IonGeocoderService
 * @see createWorldImagery
 * @see createWorldTerrain
 * @namespace Ion
 */
var Ion = {};

/**
 * Gets or sets the default QuarkGIS ion access token.
 *
 * @type {String}
 */
Ion.defaultAccessToken = defaultAccessToken;

/**
 * Gets or sets the default QuarkGIS ion server.
 *
 * @type {String|Resource}
 * @default https://api.quarkgis.com
 */
Ion.defaultServer = new Resource({ url: "https://api.cesium.com/" }); //quarkgis.com 范继高标注

Ion.getDefaultTokenCredit = function (providedKey) {
  // if (providedKey !== defaultAccessToken) {
  //   return undefined;
  // }
  //
  // if (!defined(defaultTokenCredit)) {
  //   var defaultTokenMessage =
  //     '<b> \
  //           This application is using QuarkGIS\'s default ion access token. Please assign <i>QuarkGIS.Ion.defaultAccessToken</i> \
  //           with an access token from your ion account before making any QuarkGIS API calls. \
  //           You can sign up for a free ion account at <a href="https://quarkgis.com">https://quarkgis.com</a>.</b>';
  //
  //   defaultTokenCredit = new Credit(defaultTokenMessage, true);
  // }
  //
  // return defaultTokenCredit;
};
export default Ion;
